<?php

/**

 * 会员积分变动控制器

 * @author maniac

 */

namespace app\manage\controller;



class MemberPoints extends Base

{
    /**

     * where 查询条件

     */

    public function where()

    {

        $keywords    = input('get.keywords/d', '');

        $userid    = input('get.member_id/d', 0);

        $startTime = input('get.start_time/s', '');

        $endTime   = input('get.end_time/s', '');

        $where     = [];

        if ($userid) {

            $where[] = [

                ['userid', 'eq', $userid],

            ];

        }

        if ($startTime) {

            $where[] = [

                ['change_time', 'egt', strtotime($startTime)],

            ];

        }

        if ($endTime) {

            $where[] = [

                ['change_time', 'lt', strtotime($endTime)],

            ];

        }

        $this->assign('keywords', $keywords);

        $this->assign('member_id', $userid);

        $this->assign('startTime', $startTime);

        $this->assign('endTime', $endTime);

        return $where;

    }


}

